﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="AdminExamRoom.aspx.cs" Inherits="Web.AdminExamRoom" %>
<%@ Register TagPrefix="uc1" TagName="TopMenu" Src="TopMenu.ascx" %>
<%@ Register TagPrefix="uc1" TagName="Floor" Src="Floor.ascx" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>考场管理 | 海淀区学校素质评测管理平台</title>
    <link href="css/style.css" rel="stylesheet" type="text/css" />
    <link href="js/date_input/date_input.css" rel="stylesheet" type="text/css" />
    <link href="js/boxy/stylesheets/boxy.css" rel="stylesheet" type="text/css" />
    <script src="js/jquery-1.3.2.min.js" type="text/javascript"></script>
    <script src="js/boxy/javascripts/jquery.boxy.js" type="text/javascript"></script>
    <script src="js/module.js"  type="text/javascript"></script>
    <script src="js/date_input/jquery.date_input.pack.js" type="text/javascript"></script>
    <script src="js/date_input/Date_Format.js" type="text/javascript"></script>
</head>
<body>
    <uc1:TopMenu id='menu1' runat='server'></uc1:TopMenu>
    <form id="form1" runat="server">
    <div id="main">
        <div id='block'>
        <div id='blocktitle'>考试查询</div>
        <div id='blockcontent'>
        考试名称：<asp:TextBox ID="ExamRoomName" runat="server"></asp:TextBox>
        考试时间：<asp:TextBox ID="StartDate" runat="server" ReadOnly="true"></asp:TextBox>- <asp:TextBox ID="EndDate" runat="server"  ReadOnly="true"></asp:TextBox>
        <asp:Button ID="Button1" runat="server" Text="查询" onclick="Button1_Click" /></div>
        <div id='blocktitle'><h3>考试管理</h3><em>[<a href='javascript:ShowIframe("PostExamRoom.aspx","新建考试",600,380);'>新建考试</a> | <a href='javascript:ShowIframe("PostGraduation.aspx","出入统计设置",630,400);'>出入统计设置</a> | <a href='javascript:ShowIframe("AdminGraduation.aspx","出入统计列表",650,400);'>出入统计</a>]</em></div>
        <div id="blockcontent">
        
        <asp:ListView ID="ExamRoomList" runat="server">
        <LayoutTemplate>
        <table cellpadding="5" cellspacing="1" border="0" width="100%" style="background-color:#DFDFDF" id="userlist">
        <tr style="background-color:#eee">
        <th><input id="ckAll" type="checkbox" name="ckAll" onclick="SelectAll('ckAll','form1');" /></th>
        <th width="20%">考试名称</th>
        <th width="9%">开始时间</th>
        <th width="9%">结束时间</th>
        <th width="10%">考试试卷</th>
        <th width="15%">学区报告</th>
        <th width="37%">管理</th>
        </tr>
        <asp:Label ID="itemPlaceholder" runat="server" Text="Label"></asp:Label>
        </table>
        </LayoutTemplate>
        <ItemTemplate>
            <tr style="background-color:#fff">
            <td><input id="ckItem" name="ckItem" type="checkbox" value='<%# Eval("Id")%>' /></td>
            <td><%# Eval("ExamName") %></td>
            <td><%# ((DateTime)Eval("ExamStartDate")).ToShortDateString()%></td>
            <td><%# ((DateTime)Eval("ExamEndDate")).ToShortDateString()%></td>
            <td><%# Eval("ExamPaperName")%></td>
            <td><%# Eval("ExamAreaName")%></td>
            <td>
            <a href='javascript:ShowIframe("PostComment.aspx?examid=<%# Eval("ID")%>&page=<%# Pages.PageNum %>","专家总评",500,300);'>专家总评</a> | 
            <a href='javascript:ShowIframe("PostExamRoom.aspx?editid=<%# Eval("ID")%>&page=<%# Pages.PageNum %>","编辑考试",550,380);'>编辑</a> | 
            <a href='javascript:ShowConfirm("PostExamRoom.aspx?delid=<%# Eval("ID")%>&page=<%# Pages.PageNum %>","本操作不可逆，请谨慎操作",150,50);'>删除</a> | 
            <a href='PostStudentScore.aspx?examid=<%# Eval("ID")%>'>录入成绩</a> | 
            <a href="DisplayScore.aspx?examid=<%# Eval("ID")%>">学生成绩</a> | 
            <a href="AdminExamArea.aspx?examroomid=<%# Eval("Id") %>">学区成绩</a>
            </td>
            </tr>
        </ItemTemplate>
        </asp:ListView>
        </div>
        <div><span>
        <asp:DropDownList ID="dpSchoolList" runat="server">
        </asp:DropDownList>&nbsp;
        <input type="button" name="TongJi" value="综合统计" onclick="TongJi_Click()" />&nbsp;
        <input type="button" name="Print" value="打印报表" onclick="Print_Click()" />&nbsp;
        </span></div>
        <div id="blockfloor"><asp:Label ID="PageLabel" runat="server" Text=""></asp:Label></div>
        </div>
    </div>
    </form>
    <uc1:Floor id='Floor1' runat='server'></uc1:Floor>
</body>
<script type="text/javascript">
    $("#StartDate").date_input();
    $("#EndDate").date_input();
    $("#dpSchoolList").bind("change", function() {
        var schooId = $("#dpSchoolList option:selected").get(0).value;
        ShowIframe("SchoolChartSet.aspx?SchoolId=" + schooId, "学校报表设置", 500, 300);
    });
    function SelectAll(chAllId, formId) {
        var allValue = document.forms[formId][chAllId].checked;
        for (var i = 0; i < document.forms[formId].length; i++) {
            if (document.forms[formId][i].type == "checkbox") {
                document.forms[formId][i].checked = allValue;
            }
        }
        return false;
    }
    function TongJi_Click() {
        var ids = "";
        var schoolId = $("#dpSchoolList").val();
        $("input[name='ckItem']").each(function() {
            if ($(this).attr("checked") == true) {
                ids = ids + $(this).val() + "-";
            }
        });
        if (ids == "" || schoolId == "") {
            alert("没有选择考试或学校");
            return false;
        }
        else {
            ids = ids.substring(0, ids.length - 1);
            window.open("SchoolChartSynthesize.aspx?ExamRoomIds=" + ids + "&SchoolId=" + schoolId, "综合统计");
        }
    }
    function Print_Click() {
        var ids = "";
        var schoolId = $("#dpSchoolList").val();
        $("input[name='ckItem']").each(function() {
            if ($(this).attr("checked") == true) {
                ids = ids + $(this).val() + "-";
            }
        });
        if (ids == "" || schoolId == "") {
            alert("没有选择考试或学校");
            return false;
        }
        else {
            ids = ids.substring(0, ids.length - 1);
            window.open("SchoolChartPrint.aspx?ExamRoomIds=" + ids + "&SchoolId=" + schoolId, "综合统计");
        }
    }
</script>
</html>
